package test04;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class t2 {
    public static void main(String[] args) throws IOException {
        //1、定义一个集合ArrayList
        List<String> list = new ArrayList<String>();
        //设置输入的内容提示
        System.out.println("请输入字您要录入的信息，输入end结束本次操作");
        Scanner sc = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = null;

        try {
            while((line = br.readLine()) != null){
                if("end".equals(line)){
                    break;
                }
                list.add(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        Collections.sort(list, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return 0;
            }
        });
        System.out.println(list);
    }
}
